$(function(){
    var baseurl = $('#view-content').attr('baseurl');
    var vid = $('#view-content').attr('vid');
    
    //first picture
    $.get(baseurl + '/images/venues/getvenue.php',{vid:vid,seq:'main'},function(data){
        $('#pic1').html(data);
        $('#pic1 img').addClass('image');
    });

    //second picture
    $.get(baseurl + '/images/venues/getvenue.php',{vid:vid,seq:'1'},function(data){
        $('#pic2').html(data);
        $('#pic2 img').addClass('image');
    });

    //third picture
    $.get(baseurl + '/images/venues/getvenue.php',{vid:vid,seq:'2'},function(data){
        $('#pic3').html(data);
        $('#pic3 img').addClass('image');
    });

    //third picture
    $.get(baseurl + '/images/venues/getvenue.php',{vid:vid,seq:'3'},function(data){
        $('#pic4').html(data);
        $('#pic4 img').addClass('image');
    });

    // Delete button clicked
    $('#link-delete').click(function(e){
        e.preventDefault();

        if(!confirm('Delete this venue?')){
            return;
        }

        $('#frmVenueDelete').submit();
    });

    // Change button clicked
    $('.picture input').click(function(){
        var pict = $(this).attr('pict');
        $.nmManual(baseurl + '/backend/venue/upload/type/' + pict + '/id/' + vid);
    });
});